package com.smart.translator.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class PasteA11yBridgeReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d("PasteA11yBridgeReceiver", "静态Receiver收到ACTION_TRIGGER_WECHAT_PASTE");
        if (PasteAccessibilityService.instance != null) {
            new android.os.Handler(android.os.Looper.getMainLooper()).post(() -> {

                PasteAccessibilityService.instance.enableAutoActionOnce();
                PasteAccessibilityService.clickWechatInputByKeyboardState();
                //PasteAccessibilityService.instance.clickScreen(200, 2650);
                // new android.os.Handler().postDelayed(() -> {
                //     PasteAccessibilityService.instance.pasteToWechat();
                // }, 500);
            });
        } else {
            Log.w("PasteA11yBridgeReceiver", "PasteAccessibilityService.instance为null，无法转发自动点击和粘贴");
        }
    }
} 